/**
 * 工程名称:oms
 * 文件名称:StockFmlaDAOImpl.java
 * 所属包:cn.rkylin.oms.system.stockpush.dao.impl
 * 创建时间:2017年9月4日上午11:23:24
 * Copyright (c) 2017 瑞金麟(大连)信息技术有限公司 All Rights Reserved.
 * 创建人:zhanghao
 */

package cn.rkylin.oms.system.stockpush.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO;
import cn.rkylin.oms.system.stockpush.domain.StockFmla;
import cn.rkylin.oms.system.stockpush.vo.StockFmlaVO;

/**
 * 类名:StockFmlaDAOImpl <br/>
 * 作用: 库存公式管理模块的数据访问层对象. <br/>
 * 创建原因:	 完成库存公式管理的数据库交互. <br/>
 * 创建时间:     2017年9月4日 上午11:23:24 <br/>
 * @author   zhanghao
 * @version  v1.0
 * @since    JDK 1.6
 * @see 	 
 */
@Repository(value = "stockFmlaDAO")
public class StockFmlaDAOImpl implements IStockFmlaDAO {
    
    private static final String STMT_SELECT_BY_SELECTIVE_VALUE = "selectBySelectiveFmla";
    /**
     * STMT_UPDATE_BY_UNION_KEY:根据联合主键查询仓库库存推送比例.
     * @since JDK 1.6
     */
    private static final String STMT_UPDATE_BY_PRIMARY_KEY = "updateByPrimaryKeySelectiveFmla";
    private static final String STMT_INSERT = "insertFmla";

    
    @Autowired
    protected IDataBaseFactory dao;
    
    public StockFmlaDAOImpl() {
        
    }
    
    /**
     * 方法复写
     * 根据公式id为公式设置删除标识位.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#deleteByPrimaryKey(java.lang.String)
     */
    @Override
    public int deleteByPrimaryKey(String fmlaId) {

        // TODO Auto-generated method stub
        return 0;
    }

    /**
     * 方法复写
     * 新增公式信息.
     * @throws Exception 
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#insert(cn.rkylin.oms.system.stockpush.domain.StockFmla)
     */
    @Override
    public int insert(StockFmla record) throws Exception {
        return dao.insert(STMT_INSERT, record);
    }

    /**
     * 方法复写
     * 新增公式局部.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#insertSelective(cn.rkylin.oms.system.stockpush.domain.StockFmla)
     */
    @Override
    public int insertSelective(StockFmla record) {

        // TODO Auto-generated method stub
        return 0;
    }

    /**
     * 方法复写
     * 根据id获取公式.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#selectByPrimaryKey(java.lang.String)
     */
    @Override
    public StockFmla selectByPrimaryKey(String fmlaId) {

        // TODO Auto-generated method stub
        return null;
    }

    /**
     * 方法复写
     * 更新公式局部信息.
     * @throws Exception 
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#updateByPrimaryKeySelective(cn.rkylin.oms.system.stockpush.domain.StockFmla)
     */
    @Override
    public int updateByPrimaryKeySelective(StockFmla record) throws Exception {
        return dao.update(STMT_UPDATE_BY_PRIMARY_KEY, record);
    }

    /**
     * 方法复写
     * 更新公式全部信息.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#updateByPrimaryKey(cn.rkylin.oms.system.stockpush.domain.StockFmla)
     */
    @Override
    public int updateByPrimaryKey(StockFmla record) {

        // TODO Auto-generated method stub
        return 0;
    }

    /**
     * 方法复写
     * 根据查询条件获取库存计算公式列表.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaDAO#selectBySelectiveValue(cn.rkylin.oms.system.stockpush.vo.StockFmlaVO)
     */
    @Override
    public List<StockFmla> selectBySelectiveValue(StockFmlaVO stockFmlaVO) throws Exception {
        return dao.find(STMT_SELECT_BY_SELECTIVE_VALUE, stockFmlaVO);
    }

}

